package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	Mobile    string         `gorm:"column:mobile;type:char(11);comment:手机号;not null;" json:"mobile"`           // 手机号
	Password  string         `gorm:"column:password;type:varchar(36);comment:密码;not null;" json:"password"`     // 密码
	Nickname  string         `gorm:"column:nickname;type:varchar(7);comment:昵称;not null;" json:"nickname"`      // 昵称
	Profile   string         `gorm:"column:profile;type:varchar(300);comment:头像;not null;" json:"profile"`      // 头像
	Signature string         `gorm:"column:signature;type:varchar(50);comment:个性签名;not null;" json:"signature"` // 个性签名
	Gender    string         `gorm:"column:gender;type:varchar(2);comment:性别;not null;" json:"gender"`          // 性别
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (u *User) TableName() string {
	return "user"
}
